<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>

<html>
	<head>
		<title>Digur</title>
	</head>

	<body>
		<table border="0">
			<tr>
				<td>
					<h3>
						Digur
					</h3>
				</td>
				<td>
					<a href="digur.public.jsp" target="stream_frame">Public</a>
				</td>

				<td>
					<%
						String name = (String) session.getAttribute("name");
						String password = (String) session.getAttribute("password");
						boolean isSignedIn = false;

						if (null != name && null != password && !name.equals("")
								&& !password.equals("")) {
							isSignedIn = true;
					%>
					<a href="digur.user.jsp" target="stream_frame">Profile</a>
					<%
						} else {
					%>
					<html:form action="/login">
						name: <html:text property="name" />
						password: <html:password property="password" />
						<html:submit />
					</html:form>
					<%
						}
					%>
				</td>
			</tr>
		</table>

		<iframe name="stream_frame"
			src=<%=isSignedIn ? "digur.user.jsp" : "digur.public.jsp"%>
			width="100%" height="100%" frameborder="0" marginwidth="0"
			marginheight="0" scrolling="no"
			onload="this.height=stream_frame.document.body.scrollHeight" />
	</body>
</html>